const path = require('path');
const w    = require('webpack');
module.exports = {
    entry: {
        idx: path.resolve(__dirname, 'src/idx.js'),
	vendor: ['lodash']
    },
    output: {
        path: path.resolve(__dirname, 'dist/'),
        filename: '[name].[chunkHash].js'
    },
    plugins: [
        new w.NamedChunksPlugin(),
        new w.NamedModulesPlugin(),
        new w.optimize.CommonsChunkPlugin({
            name: 'vendor',
            minChunks: Infinity // 希望打包出来的只要它自己没有别的
        }),
        new w.optimize.CommonsChunkPlugin({
            name: 'manifest',
            chunks: ['idx', 'vendor'],
            minChunks: 2
        })
    ]
}
